<?php defined('SYSPATH') or die('No direct script access.');
 
class Form_Input extends Form_Input_Core 
{
    public function label($val = NULL)
    {
        if ($val === NULL)
        {
            if (isset($this->data['name']) AND isset($this->data['label']))
            {
                // Set the label name, add the visual HTML for "required" fields
                $label = $this->data['label'].(in_array('required', $this->rules) ? ' <em>*</em>' : '');
 
                return form::label($this->data['name'], $label);
            }
            return FALSE;
        }
 
        return parent::label($val);
    }
}